--信仰传承
local xingyangchuanchen = fk.CreateSkill {
    name = "mcdh_xingyangchuanchen"
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

xingyangchuanchen:addEffect(fk.EventPhaseStart,{
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(self) and target.phase == Player.Start and
                (target == player or player:inMyAttackRange(target)) and player:getMark("mcdh_charge") >= 3 and
                target:getMark("@@mcdh_butuizhiqi-mark") == 0
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        lib.LoseCharge(player, player, 3, self.name)
        room:setPlayerMark(target, "@@mcdh_butuizhiqi-mark", 1)
        for _, p in ipairs(room:getAlivePlayers()) do
            if p ~= player and p ~= target then
                room:setPlayerMark(p, "@@mcdh_butuizhiqi-mark", 0)
            end
        end
    end
})

Fk:loadTranslationTable {
    ["mcdh_xingyangchuanchen"] = "信仰传承",
    [":mcdh_xingyangchuanchen"] = "蓄力技(3)，你或你攻击范围内的一名角色的准备阶段，若其没有「军旗」，你可以令其获得「军旗」标记，且移去除你与其以外的角色的「军旗」。"
}

return xingyangchuanchen